import java.util.*;

public class S_et {
    public static void main(String[] args) {
        Set set = new Set() {
            int[] set = new int[10];
            int size = 0;

            public int size() {
                return size;
            }

            public boolean isEmpty() {
                return false;
            }

            public boolean contains(Object o) {
                return false;
            }

            public Iterator iterator() {
                return null;
            }

            public Object[] toArray() {
                return new Object[0];
            }

            public boolean add(Object o) {
                for (int i = 0; i < size; i++) {
                    if (((Integer) o) == (set[i])) {
                        return false;
                    }
                }
                set[size++] = (((Integer) o).intValue());
                return true;
            }

            public boolean remove(Object o) {
                return false;
            }

            public boolean addAll(Collection c) {
                return false;
            }

            public void clear() {

            }

            public boolean equals(Object o) {
                return false;
            }

            public int hashCode() {
                for (int i = 0; i < size; i++) {
                    System.out.print(set[i] + " ");
                }
                System.out.println();
                return 0;
            }

            public boolean removeAll(Collection c) {
                return false;
            }

            public boolean retainAll(Collection c) {
                return false;
            }

            public boolean containsAll(Collection c) {
                return false;
            }

            public Object[] toArray(Object[] a) {
                return new Object[0];
            }
        };
        List list = new List() {
            int size = 0;
            int[] list = new int[10];

            @Override
            public int size() {
                return size;
            }

            @Override
            public boolean isEmpty() {
                for (int i = 10; i > 0; i--) {
                    int max = Integer.MIN_VALUE;
                    int temp = 0;
                    for (int j = 0; j < i; j++) {
                        if (list[j] > max) {
                            max = list[j];
                            temp = j;
                        }
                    }
                    list[temp] = list[i - 1];
                    System.out.print(max + " ");
                }
                System.out.println();
                return false;
            }

            @Override
            public boolean contains(Object o) {
                return false;
            }

            @Override
            public Iterator iterator() {
                return null;
            }

            @Override
            public Object[] toArray() {
                return new Object[0];
            }

            @Override
            public Object[] toArray(Object[] a) {
                return new Object[0];
            }

            @Override
            public boolean add(Object o) {
                list[size++] = (Integer) o;
                return false;
            }

            @Override
            public boolean remove(Object o) {
                return false;
            }

            @Override
            public boolean containsAll(Collection c) {
                return false;
            }

            @Override
            public boolean addAll(Collection c) {
                return false;
            }

            @Override
            public boolean addAll(int index, Collection c) {
                return false;
            }

            @Override
            public boolean removeAll(Collection c) {
                return false;
            }

            @Override
            public boolean retainAll(Collection c) {
                return false;
            }

            @Override
            public void clear() {
                for (int i = size - 1; i >= 0; i--) {
                    System.out.print(list[i] + " ");
                }
                System.out.println();
            }

            @Override
            public Object get(int index) {
                return null;
            }

            @Override
            public Object set(int index, Object element) {
                return null;
            }

            @Override
            public void add(int index, Object element) {

            }

            @Override
            public Object remove(int index) {
                return null;
            }

            @Override
            public int indexOf(Object o) {
                return 0;
            }

            @Override
            public int lastIndexOf(Object o) {
                return 0;
            }

            @Override
            public ListIterator listIterator() {
                return null;
            }

            @Override
            public ListIterator listIterator(int index) {
                return null;
            }

            @Override
            public List subList(int fromIndex, int toIndex) {
                return null;
            }
        };
        comparableTreeSet.Person[] people = new comparableTreeSet.Person[10];
        for (int i = 0; i < 10; ) {
            int num = (int) (Math.random() * 51);
            if (set.add(num)) {
                list.add(num);
                people[i] = new comparableTreeSet.Person(i, num);
                i++;
            }
        }
        set.hashCode();
        list.clear();
        list.isEmpty();
        Map map = new Map() {
            String[] key = {"", "", "", "", "", "", "", "", "", ""};
            int[] value = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1};
            int size = 0;

            @Override
            public int size() {
                return size;
            }

            @Override
            public boolean isEmpty() {
                return false;
            }

            @Override
            public boolean containsKey(Object key) {
                return false;
            }

            @Override
            public boolean containsValue(Object value) {
                return false;
            }

            @Override
            public Object get(Object key) {
                if (key instanceof String) {
                    for (int i = 0; i < this.key.length; i++) {
                        if (this.key[i].equals(key)) {
                            System.out.println(value[i]);
                            return null;
                        }
                    }
                    System.out.println("没有");
                } else {
                    int n = (Integer) key;
                    System.out.print(this.key[n] + ":" + value[n] + " ");
                }
                return null;
            }

            @Override
            public Object put(Object key, Object value) {
                for (int i = 0; i < 10; i++) {
                    if ((Integer) value > this.value[i]) {
                        if (this.value[i] != -1) {
                            for(int j=size;j>i;j--){
                                this.key[j] = this.key[j-1];
                                this.value[j] = this.value[j-1];
                            }
                        }
                        this.key[i] = (String) key;
                        this.value[i] = (Integer) value;
                        break;
                    }
                    else if ((Integer) value == this.value[i]){
                        for(int j=size;j>i;j--){
                            if ((Integer) value == this.value[j-1]){
                                this.key[j] = (String) key;
                                this.value[j] = (Integer) value;
                                break;
                            }
                            else {
                                this.key[j] = this.key[j-1];
                                this.value[j] = this.value[j-1];
                            }

                        }
                    }
                }
                size++;
                return null;
            }

            @Override
            public Object remove(Object key) {
                return null;
            }

            @Override
            public void putAll(Map m) {

            }

            @Override
            public void clear() {

            }

            @Override
            public Set keySet() {
                return null;
            }

            @Override
            public Collection values() {
                return null;
            }

            @Override
            public Set<Entry> entrySet() {
                return null;
            }
        };
        for (int i = 0; i < 10; i++) {
            String s = people[i].name;
            int n = people[i].age;
            System.out.print(s + ":" + n + " ");
            map.put(s, n);
        }
        System.out.println();
        for (int i = 0; i < 3; i++) {
            map.get(i);
        }
        System.out.println();
        map.get("J");
        map.get("A");
        map.get(1);
        map.get("A");
    }
}
